import useVoiceModel, { RobotModelListProps, VoiceListProps } from "@/hooks/useVoiceModel"
import { defineStore } from "pinia"

const { modelOptions, allVoiceOptions, getVoiceList, initRobotModelList } = useVoiceModel()

// getVoiceList()
// initRobotModelList('')

export const useDigitalStore = defineStore("digitalStore", {
    state: () => ({
        // 语音模型模块信息
        voiceModel: allVoiceOptions.value as VoiceListProps[],
        // 数字人模型模块信息
        vHumanModel: modelOptions.value.vHumanName as RobotModelListProps[],
        // 云珊科技模型模块信息
        yunShanModel: modelOptions.value.yunShanName as { name: string }[],
        // 语音模块
        AU: modelOptions.value.AU as { count: number; list: VoiceListProps[] },
        CHAT: modelOptions.value.CHAT as { count: number; list: VoiceListProps[] },
        BARD: modelOptions.value.BARD as { count: number; list: VoiceListProps[] }
    }),
    actions: {
        upDataVoiceList() {
            getVoiceList()
            initRobotModelList('')
        },
    }
})
